/**
 * @author Alfort Robert - Köckinger Martin
 * Main Class - handles Menu
 * @version 2.1
 */

package at.fhj.itm;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

/** Called when the activity is first created. */
public class AndroidQR extends Activity {
	
	public Button encode; /** Creating a Button for encoding */
	public Button decode; /** Creating a Button for decoding */
	public Button info; /** creating a Button for info */

	/**
	 * On Create sets basic Information
	 */
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.main); /** ContentView is set to Main layout */

		/**
		 * Defining Buttons by ID of a special layout
		 */
		encode = (Button) findViewById(R.id.button_encode);
		decode = (Button) findViewById(R.id.button_decode);
		info = (Button) findViewById(R.id.button_info);
		
		/**
		 * Starts Activity QRCodeEncode.class
		 * @see at.fhj.itm.QRCodeEncode.class
		 * @see at.fhj.itm.QREncoder.class
		 * @see android.app.Activity;
		 * @see android.content.Intent;
		 */
		encode.setOnClickListener(new OnClickListener() {
			public void onClick(View arg0) {
				startActivity(new Intent(getApplicationContext(), QRCodeEncode.class));
			}
		});
		
		/**
		 * Starts Activity QRCodeDecode.class
		 * @see at.fhj.itm.QRCodeDecode.class
		 * @see at.fhj.itm.QRDecoder.class
		 * @see android.app.Activity;
		 * @see android.content.Intent;
		 */
		decode.setOnClickListener(new OnClickListener() {
			public void onClick(View arg0) {
				startActivity(new Intent(getApplicationContext(), QRCodeDecode.class));
			}
		});
		
		/**
		 * Starts Activity QRInfo.class
		 * @see at.fhj.itm.QRInfo.class
		 * @see android.app.Activity;
		 * @see android.content.Intent;
		 */
		info.setOnClickListener(new OnClickListener() {
			public void onClick(View arg0) {
				startActivity(new Intent(getApplicationContext(), QRInfo.class));
			}
		});
	}
}